﻿//拖动改变大小
ISS_MAP_Resize = function (el, reel) {
    //初始化参数
    var els = el.style,
    //鼠标的 Y 轴坐标
    y = 0;
    //鼠标按下
    $(el).mousedown(function (e) {
        //按下元素后，计算当前鼠标与对象计算后的坐标
        y = e.clientY - el.offsetHeight;
        //支持setCapture判断
        el.setCapture ? (
        //捕捉焦点
                    el.setCapture(),
        //设置事件
                    el.onmousemove = function (ev) {
                        mouseMove(ev || event);
                    },
                    el.onmouseup = mouseUp
                ) : (
        //绑定事件
                    $(document).bind("mousemove", mouseMove).bind("mouseup", mouseUp)
                );
        //防止默认事件发生
        e.preventDefault();
    });
    //移动事件
    function mouseMove(e) {
        reel.style.height = "calc(100% - " + e.clientY + "px)";
    }
    //停止事件
    function mouseUp() {
        //在支持 releaseCapture 做些东东
        el.releaseCapture ? (
        //释放焦点
                    el.releaseCapture(),
        //移除事件
                    el.onmousemove = el.onmouseup = null
                ) : (
        //卸载事件
                    $(document).unbind("mousemove", mouseMove).unbind("mouseup", mouseUp)
                );
    }
}